import Vue from "vue";
import VueRouter from "vue-router";
import staticRoutes from "./staticRouter";
// import recursonRoutes from "./recursonRoutes";

// const originalPush = VueRouter.prototype.push;
// VueRouter.prototype.push = function push(location) {
//   return originalPush.call(this, location).catch((err) => {
//     console.log(1, err.toString());
//   });
// };

Vue.use(VueRouter);

const routes = [
  // {
  //   //登录页
  //   path: "/login",
  //   name: "Login",
  //   component: () =>
  //     import(/*webpackChunkName:'Login'*/ "../views/Login/index"),
  // },
  // {
  //   //404
  //   path: "/404",
  //   name: "404",
  //   component: () => import(/* webpackChunkName: "404" */ "../views/404.vue"),
  // },
  // { path: "*", redirect: "/404" },
  ...staticRoutes,
  // ...recursonRoutes,
  // {
  //   //登录页
  //   path: "/login",
  //   name: "Login",
  //   component: () =>
  //     import(/*webpackChunkName:'Login'*/ "../views/Login/index"),
  // },
  // {
  //   path: "/",
  //   alias: "/",
  //   component: () =>
  //     import(/*webpackChunkName:'Welcome'*/ "../views/Layout.vue"),
  //   children: [
  //     {
  //       //学员项目管理
  //       path: "/welcome",
  //       meta: { title: "glsy" },
  //       component: () =>
  //         import(/*webpackChunkName:'Product'*/ "@/views/Welcome/index"),
  //     },
  //     {
  //       //学员项目管理
  //       path: "/studentManager/product",
  //       meta: { title: "xyxmgl" },
  //       component: () =>
  //         import(
  //           /*webpackChunkName:'Product'*/ "@/views/StudentManager/Product.vue"
  //         ),
  //     },
  //     {
  //       //学员资料
  //       path: "/studentManager/profill",
  //       meta: { title: "xyzl" },
  //       component: () =>
  //         import(
  //           /*webpackChunkName:'Profill'*/ "@/views/StudentManager/Profill.vue"
  //         ),
  //     },
  //     {
  //       //学员宿舍
  //       path: "/studentManager/dormitory",
  //       meta: { title: "xysh" },
  //       component: () =>
  //         import(
  //           /*webpackChunkName:'Dormitory'*/ "@/views/StudentManager/Dormitory.vue"
  //         ),
  //     },
  //     {
  //       //考勤管理
  //       path: "/attendance",
  //       meta: { title: "kxgl" },
  //       component: () =>
  //         import(
  //           /*webpackChunkName:'Attendance'*/ "@/views/Attendance/index.vue"
  //         ),
  //     },
  //     {
  //       //用户管理
  //       path: "/users",
  //       meta: { title: "yhgl" },
  //       component: () =>
  //         import(/*webpackChunkName:'Users'*/ "@/views/Users/index.vue"),
  //     },
  //     {
  //       //数据统计
  //       path: "/statistics",
  //       meta: { title: "sjtj" },
  //       component: () =>
  //         import(
  //           /*webpackChunkName:'Statistics'*/ "@/views/Statistics/index.vue"
  //         ),
  //     },
  //     {
  //       //我的中心
  //       path: "/mine",
  //       meta: { title: "wdzx" },
  //       component: () =>
  //         import(/*webpackChunkName:'Mine'*/ "@/views/Mine/index.vue"),
  //     },
  //     {
  //       //vip充值
  //       path: "/vipmanager/charge",
  //       meta: { title: "vipCharge" },
  //       component: () =>
  //         import(/*webpackChunkName:'Charge'*/ "@/views/Vipmanager/charge.vue"),
  //     },
  //     {
  //       //订单管理
  //       path: "/vipmanager/order",
  //       meta: { title: "order" },
  //       component: () =>
  //         import(/*webpackChunkName:'Order'*/ "@/views/Vipmanager/order.vue"),
  //     },
  //   ],
  // },
];

const router = new VueRouter({
  routes,
});

export default router;
